package com.xqb.modules.service.impl;

import com.xqb.common.utils.DateUtils;
import com.xqb.modules.domain.po.StdLikedRecord;
import com.xqb.modules.mapper.StdLikedRecordMapper;
import com.xqb.modules.service.IStdLikedRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 点赞记录Service业务层处理
 * 
 * @author xqb
 * @date 2024-10-14
 */
@Service
public class StdLikedRecordServiceImpl implements IStdLikedRecordService
{
    @Autowired
    private StdLikedRecordMapper stdLikedRecordMapper;

    /**
     * 查询点赞记录
     * 
     * @param id 点赞记录主键
     * @return 点赞记录
     */
    @Override
    public StdLikedRecord selectStdLikedRecordById(Long id)
    {
        return stdLikedRecordMapper.selectStdLikedRecordById(id);
    }

    /**
     * 查询点赞记录列表
     * 
     * @param stdLikedRecord 点赞记录
     * @return 点赞记录
     */
    @Override
    public List<StdLikedRecord> selectStdLikedRecordList(StdLikedRecord stdLikedRecord)
    {
        return stdLikedRecordMapper.selectStdLikedRecordList(stdLikedRecord);
    }

    /**
     * 新增点赞记录
     * 
     * @param stdLikedRecord 点赞记录
     * @return 结果
     */
    @Override
    public int insertStdLikedRecord(StdLikedRecord stdLikedRecord)
    {
        stdLikedRecord.setCreateTime(DateUtils.getNowDate());
        return stdLikedRecordMapper.insertStdLikedRecord(stdLikedRecord);
    }

    /**
     * 修改点赞记录
     * 
     * @param stdLikedRecord 点赞记录
     * @return 结果
     */
    @Override
    public int updateStdLikedRecord(StdLikedRecord stdLikedRecord)
    {
        stdLikedRecord.setUpdateTime(DateUtils.getNowDate());
        return stdLikedRecordMapper.updateStdLikedRecord(stdLikedRecord);
    }

    /**
     * 批量删除点赞记录
     * 
     * @param ids 需要删除的点赞记录主键
     * @return 结果
     */
    @Override
    public int deleteStdLikedRecordByIds(Long[] ids)
    {
        return stdLikedRecordMapper.deleteStdLikedRecordByIds(ids);
    }

    /**
     * 删除点赞记录信息
     * 
     * @param id 点赞记录主键
     * @return 结果
     */
    @Override
    public int deleteStdLikedRecordById(Long id)
    {
        return stdLikedRecordMapper.deleteStdLikedRecordById(id);
    }
}
